<?php
require_once($_SERVER['DOCUMENT_ROOT']."/defaultconf.mex");
require_once($GLOBALS['PAD']."Modules/FJK46JDE/modconf.php"); 
MYTCONN();
	form_pr('rh_settings','','','post'); 
	$get_rhmembers = "SELECT smb_ID AS ID, smb_Name AS NAME FROM systemoffice.staff_members WHERE smb_Domain = 0";
	$GET_RULES = $GLOBALS['MYT']->db_array("SELECT * FROM systemoffice.staff_rules WHERE srl_Flag = 2");
	echo '<div class="title">Notificacoes | ';
		mn_field('button','ED','srl_New','Nova Regra','','','','"
			onclick="idwindow(\'Criar nova regra\',\'user_properties\',\'user_form\',\'_response/call.php?get=SecurityCenter/frm_rule.php\',500,300);');
	echo '</div>
	<div class="Line" style="margin:3">';
	echo '<table cellspacing="3" width="100%">
	<tr><td>Processo</td><td>Accao</td><td>Departamento</td><td>Funcionario</td><td>Periodo</td></tr>';
	$GetRules = $GLOBALS['MYT']->db_array("SELECT * FROM systemoffice.staff_rules 
								INNER JOIN systemoffice.staff_members ON smb_ID = srl_User 
								INNER JOIN systemoffice.main_offices ON ref = srl_Department
								WHERE srl_Flag = 2");
	for ($i=1;$i<=$GetRules[0];$i++) {
		echo '<tr><td>'.$GetRules[$i]['srl_Name'].' </td><td> Notificar </td><td> '.$GetRules[$i]['name'].' </td><td> '.$GetRules[$i]['smb_Name'].' </td><td> Periodo: '.$GetRules[$i]['srl_Days'].' DIAS ANTES ';
		echo'</td></tr>
		<tr><td colspan="8"><hr width="100%" size="1" /></td></tr>';
	
	}
	echo '</table>
	</div>
	';
	
?>
</form>